<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

/**
 * App\Models\Config
 *
 * @property-read mixed $config
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Config newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Config newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Config query()
 * @mixin Model
 */
class Config extends Model
{
    protected $table      = 'configs';
    protected $primaryKey = 'id';
    public    $columns    = [
        'id',
        'name',
        'config',
        'status',
        'created_at',
        'updated_at',
    ];

    public $guarded = ['id'];

    public function getConfigAttribute($value)
    {
        return json_decode($value, true);
    }
}